<#compress>
<!DOCTYPE>
<html>
<head>
    <#include "info/include.ftl"/>
    <script type="text/javascript" src="${base}/js/plugins/buttons/spin.min.js"></script>
    <script type="text/javascript" src="${base}/js/plugins/buttons/ladda.min.js"></script>
</head>
<body style="background: white">
<div class="panel-body">
    <form id="commentForm">
        <input type="hidden"name="code" id="code" value="${command.code}"/>
        <#--<input type="hidden" id="name" value="${command.name}" name="name"/>-->
        <#--<input type="hidden" id="startdate" value="${command.startdate}" name="startdate" size="30" />-->
        <#--<input  type="hidden" id="enddate" value="${command.enddate}" name="enddate" size="30" />-->
        <#--<input  type="hidden" id="name" value="${command.moneylimit}" name="name" class="form-control"/>-->
        <#--<input  type="hidden" id="flag" value="${command.flag}" name="flag" class="form-control"/>-->
        <table class="table table-striped table-bordered" style="max-width: 600px;">
            <tr>
                <th>人员同步方式：</th>
                <td>
                    <select id="synctype" name="synctype" class="form-control">
                        <option value="0" ${(command.synctype=='0')?string('selected="selected"','')}>手动</option>
                        <option value="1" ${(command.synctype=='1')?string('selected="selected"','')}>自动</option>
                    </select>
                </td>
            </tr>
            <tr id="synctime-tr">
                <th>人员同步间隔时间（分钟）：</th>
                <td>
                    <input  type="number" id="synctime" value="${command.synctime}" name="synctime" size="30" />
                </td>
            </tr>

        </table>
    </form>
    <div style="text-align: center;margin-top: 10px">
        <button style="width: 120px" class="btn btn-primary btn-ladda btn-ladda-spinner" data-style="expand-right" data-spinner-color="#333" data-spinner-size="20" type="button" onclick="save()">提交</button>
    </div>
</div>
<script>

    function save() {
        var synctype=$('#synctype').val();
        var synctime=$('#synctime').val();
        var l = Ladda.create( document.querySelector( '.btn-ladda-spinner' ) );
        l.start();
        post('pl/platform/saveContext',{code:'${command.code}',synctype:synctype,synctime:synctime},function (result) {
            if(result.code==0){
                parent.table.ajax.reload();
                dialogClose();
            }else{
                alertError(result.message);
            }
            l.stop();
        });

    }
</script>
</body>
</html>
</#compress>